
package solvoku.model.game;

/**
 *
 * @author Steve Cancès <steve.cances@gmail.com>
 */
public class CoupAJouer {
    private final Case c;
    private final int value;
    
    public CoupAJouer(Case c, int value){
        this.c = c;
        this.value = value;
    }

    /**
     * @return the c
     */
    public Case getC() {
        return c;
    }

    /**
     * @return the value
     */
    public int getValue() {
        return value;
    }

    @Override
    public String toString() {
        return "CoupAJouer{" + "c=" + c + ", value=" + value + '}';
    }
    
    
    
    public boolean jouerCoup(){
        boolean okCoup = true;
        c.setValue(this.value);
        boolean okLigne = c.getLigne().majPossibilitesCase(this.value);
        boolean okColonne = c.getColonne().majPossibilitesCase(this.value);
        boolean okBloc = c.getBloc().majPossibilitesCase(this.value);
        return (okLigne && okColonne && okBloc);
    }
}
